import React from 'react'
import { Outlet, useNavigate } from 'react-router-dom'

export default function Home() {
  /* 
    使用NavLink或者Link进行跳转 被称作为声明式路由导航
    使用navigte方法进行路由跳转,被称作为编程式路由导航
  
  */
  const navigate = useNavigate();

  const toMusicHandle = () => {
    navigate("/main/home/music")
  }

  const toNewsHandle = () => {
    navigate("/main/home/news")
  }
  return (
    <div>
      <h3>我是Home的内容</h3>
      <button onClick={toMusicHandle}>Music</button>
      <button onClick={toNewsHandle}>News</button>
      <Outlet />
    </div>
  )
}
